import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/index/Layout'
import Index from '@/views/index/Index'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'root',
        redirect: '/index',
        component: Layout,
        children: [{
            path: '/index',
            name: 'index',
            component: Index
        }, {
            path: '/download',
            component: () =>
                import ('@/views/download'),
        }, {
            path: '/construct',
            component: () =>
                import ('@/views/construct'),
        }]
    },
    {
        path: '/search',
        name: 'search',
        component: () =>
            import ('@/views/serach/index.vue'),
    }
]

const router = new VueRouter({
    //mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router